const cloud = require('wx-server-sdk')
cloud.init()
const db = cloud.database()
exports.main = async (event, context) => {
  const picsResult = await db.collection("sort").orderBy('sortNum', 'asc').where({
    isShow:0
  }).get()
  if (picsResult.errMsg == "collection.get:ok") {
    return {
      code: 0,
      data: picsResult.data
    }
  } else {
    return {
      code: 1,
      data: picsResult.errMsg
    }
  }
}